package org.jeecg.modules.zhoupackage.GoodsOrder.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.jeecg.modules.zhouAdmin.admin.goodsCenter.pojo.MlccThirdGoods;
import org.jeecg.modules.zhouAdmin.admin.goodsCenter.pojo.MlccThirdGoodsRange;
import org.jeecg.modules.zhouAdmin.admin.goodsCenter.pojo.MlccThirdGoodsandparameter;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 现货购物车表
 */
@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class MlccThirdGoodsCart {

    private String id;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 现货id
     */
    private String goodsId;

    /**
     * 数量
     */
    private String goodsNum;

    /**
     * 总价
     */
    private BigDecimal sumMoney;

    /**
     * 状态：默认0加入购物车，1移除购物车，2已经编入订单（不单独查询）
     */
    private Integer status;

    /**
     * 备注
     */
    private String remark;


    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    private String updateBy;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    private String sysOrgCode;

    /**
     * 包含的现货对象
     */
    @TableField(exist = false)
    private MlccThirdGoods goods;

    /**
     * 购物车总价
     */
    @TableField(exist = false)
    private BigDecimal allPrice;


    /**
     * 阶梯价
     */
    @TableField(exist = false)
    private MlccThirdGoodsRange range;

    /**
     * 购物车不同款式的具体购买数量
     */
    @TableField(exist = false)
    List<MlccThirdCartBuynum> byNum;

    /**
     * 商品参数
     */
    @TableField(exist = false)
    List<MlccThirdGoodsandparameter> goodsParam;
}
